The invention relates to real-time tracing of local data in order to debug real-time software on microprocessors. The debugger described is particularly useful where software is to be included in an embedded real-time microprocessor system that has a self-contained operating system. The correct functioning of such software depends on its time behavior Some examples of such applications are robot manipulator and sensor systems, automatic process control systems, schematic test equipment, and disc drive interrupt software. In these systems, a programmer typically writes an application program on a development system and then downloads the program into a dedicated microprocessor.
The most common method of debugging is to trace the values of variables in a program during execution. Printouts of the trace then show the evolution of processing in the program. Most such traces are accomplished by putting print statements in the program. This procedure is cumbersome for the programmer. It also distorts the timing of the program, which prevents the debugging from showing true real-time performance.
One prior art system for debugging high level languages in real-time is disclosed in A. M. Chesir, "A Real-Time High-Level Language Debugging System", dissertation presented to the Cooper Union for the Advancement of Science and Art in July 1984 ("Chesir)". This dissertation appears as Appendix A to the present application. Appendix A is available in the patented file. A summary of this prior art reference is found in FIG. 1. In FIG. 1, a user 101 interacts with a host processor 103. The user enters a high level computer program source code representation into the host processor 103. In the host processor 103, the high level source code is compiled. The compiled high level source code is transmitted to a target processor 105. At the host processor 103, the user 101 indicates which global variables in his or her source code are to be traced during a run of the computer program. The debugger 107 traces data appearing on the pins of the target processor 105 by means of clamp-on probe 109. The clamp-on probe 109 transmits to the debugger 107 the values appearing on the pins of the target processor 105 in real-time. The running of the program on a target processor is not affected in any way.
Prior to running the program on the target processor 105, the user 101 selects global variables to be traced using the host processor 103. The tag table memory 113 keeps track of which global variables are to be traced. The trace buffer memory 115 keeps track of the values of those global variables during the running of the computer program. The debugger control processor 111 acts as an interface with the host processor 103. The decision logic 117 controls the collection of trace history while the target processor is running. For every bus cycle of the target processor 105, the decision logic 117 determines whether that cycle should be traced by using the information in the tag table memory 113 as a reference. If the cycle is to be traced then information from the pins of the target processor is transferred to the trace buffer memory 115.
The Chesir debugger only traced static variables. It is desirable to trace dynamic local data in programs as well.
An example of a high level language debugger which does trace dynamic local variables is in M. Goossens "Real-Time High-Level Language Debugging Tools", dissertation submitted to the Free University of Brussels in March of 1985. Like Chesir Goossens uses a tag table memory, but the tag table memory is adapted to local variables. The Goossens dissertation does not explain how to trace local data when there is a context switch. Goossens provides for tracing variables in several procedures at once. However, for each procedure which is added, the hardware increases substantially in complexity.
Another high level language debugger is disclosed in European Patent Application No. 86100895.1 "Method and Apparatus for Software Debugging." This debugger emulates the operation of the 68000 processor. Because of the emulation, certain real-time properties of the processor may be lost. In particular, the timing of certain events may be distorted. In addition, the European patent application does not allow for selection of particular variables to be traced, but instead traces variables within a range. Moreover, the European patent application does not indicate how to trace variables from more than one procedure.
The above described prior art therefore leaves open how to trace selected dynamic local data in real-time when there are process context switches; where a context switch is defined as a change in machine state for the purpose of suspending the currently running process and resuming another process. Such context switches can occur at arbitrary points within procedures.